package com.ynding.cloud.auth.server.admin.service.api.impl;

import com.ynding.cloud.auth.api.admin.api.IUserApiService;
import com.ynding.cloud.auth.api.admin.domain.UserDO;
import com.ynding.cloud.auth.server.admin.service.IUserService;
import com.ynding.cloud.common.model.bo.ResponseBean;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * <p> </p>
 *
 * @author ynding
 * @version 2021/9/9
 **/
@Slf4j
@DubboService(version = "1.0.0", timeout = 5000)
@RequiredArgsConstructor
public class UserApiServiceImpl implements IUserApiService {

    private final IUserService userService;

    @Override
    public UserDO loadUserByUsername(String username) throws UsernameNotFoundException {
        return userService.loadUserByUsername(username);
    }

    @Override
    public ResponseBean userReg(String username, String password) {
        return userService.userReg(username, password);
    }
}
